package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * 对象流
 */
public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name="小王";
        int age=16;
        String gender="半男半女";
        String[] otherInfo={"器大活好小年轻","喜欢孙尚香","抖音记事本"};
        Person w=new Person(name,age,gender,otherInfo);
        System.out.println(w);
        FileOutputStream fos=new FileOutputStream("person.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(w);
        System.out.println("写进去了");
        oos.close();
    }
}
